#include"my_vector.h"

namespace baka
{
	void test1()
	{
		my_vector<int> v1;
		my_vector<int> v2(5,2);
		my_vector<int> v3(v2.begin(), v2.end());
		my_vector<int> v4(v2);
		my_vector<int> v5 = v2;
		v1 = v2;
		print_vector(v2);
		print_vector(v4);
		print_vector(v5);
		print_vector(v1);

	}
	void test2()
	{
		my_vector<int> v1;
		my_vector<int> v2(5,2);
		cout << v2.size() << endl;
		cout << v2.capacity() << endl;
		v2.resize(10,20);
		cout << v2.size() << endl;
		cout << v2.capacity() << endl;
		v2.resize(5);
		cout << v2.size() << endl;
		cout << v2.capacity() << endl;
	}
	void test3()
	{
		my_vector<int> v1;
		my_vector<int> v2(5, 2);
		for (int i = 0; i < 5; i++)
		{
			cout << v2[i] << " ";
		}
		cout << endl;
		for (auto a : v2)
		{
			cout << a << " ";
		}
		cout << endl;

		my_vector<int>::iterator it=v2.begin();
		for (int i = 0; i < 5; i++)
		{
			cout << *it++ << " ";
		}
		print_vector(v2);
	}
	void test4()
	{
		my_vector<int> v1;
		v1.push_back(1);
		v1.push_back(2);
		v1.push_back(3);
		v1.push_back(4);
		v1.push_back(5);
		print_vector(v1);
		v1.pop_back();
		print_vector(v1);

	}
	void test5()
	{
		my_vector<int> v1;
		v1.push_back(1);
		v1.push_back(2);
		v1.push_back(3);
		v1.push_back(4);
		v1.push_back(5);
		v1.push_back(6);
		v1.push_back(7);
		print_vector(v1);

		v1.insert(v1.begin() + 4, 10);
		v1.insert(v1.begin(), 9);
		v1.insert(v1.end(), 9);
		print_vector(v1);


		v1.erase(v1.begin() + 4);
		v1.erase(v1.begin());
		v1.erase(v1.end());
		print_vector(v1);

	}
}

int main()
{

	baka::test1();
	return 0;
}